package com.yu.service.impl;

import com.yu.dto.CcCodingDTO;
import com.yu.entity.AuthUser;
import com.yu.service.CcCodingService;
import com.yu.util.WebServiceContextUtil;
import org.apache.cxf.interceptor.InInterceptors;
import org.springframework.stereotype.Component;

import javax.jws.WebService;
import java.util.List;

/**
 * @author : wenchao.long
 * @date : Created in 2021/01/05 11:11 周二
 * @description :
 */
@InInterceptors(interceptors = "com.yu.interceptor.AuthInterceptor")
@WebService(
        serviceName = "CcCodingService",
        targetNamespace = "http://service.yu.com",
        endpointInterface = "com.yu.service.CcCodingService"
)
@Component
public class CcCodingServiceImpl implements CcCodingService {

    @Override
    public String saveCcCoding(List<CcCodingDTO> ccCodingList) {
        AuthUser authUser = (AuthUser) WebServiceContextUtil.getAttribute("userName");
        String remoteAddr = WebServiceContextUtil.getRemoteAddr();
        System.out.println(ccCodingList);
        System.out.println(authUser);
        System.out.println(remoteAddr);
        return "ok!";
    }

    @Override
    public String getAttributeValue(String name) {
        System.out.println(name);
        return name;
    }
}
